package com.chenfan.mcn.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 评论业务类型
 *
 * @Author liuyang
 * @Date 2021/5/20
 * @Time 18:25
 * @Version V1.0
 **/
@AllArgsConstructor
@SuppressWarnings("AlibabaEnumConstantsMustHaveComment")
public enum CommentBusinessTypeEnum {

    /**
     * 评论操作日志的操作类型
     */

    INCOME_CONTRACT(1, "收入合同", "revenueContractDetail", "page"),

    EXECUTION_ORDER(2, "执行单", "executionOrderDetail", "page"),

    YEAR_FRAME_CONTRACT(3, "年框合同", "view/baseData/yearContract/comps/detail", "drawer"),

    CLEAR_ORDER(4, "核销管理", null, "drawer"),

    TAX_INVOICE(5, "开票管理", "view/baseData/invoiceManage/detail", "drawer"),

    PURCHASE_CONTRACT(6, "采购合同", "view/baseData/procurementContract/comps/detail", "drawer"),

    DISCOUNT_APPROVAL_ORDER(7, "折扣返点审批单", "view/baseData/discountRebates/comps/detail", "drawer"),

    ANNUAL_REBATE_APPROVAL_ORDER(8, "客户返点审批单", "view/baseData/annualRebateApproval/detail", "drawer"),

    STAR_REBATE_CONTRACT(9, "红人返点合同", "redsContractDetail", "page"),

    STAR_MONTHLY_SETTLEMENT(10, "红人月度结算单", "starMonthlySettlementDetail", "page"),

    SAMPLE_DEVELOPMENT(11, "打样任务", "developmentSampleDetail", "page"),

    INTENTION_ORDER(12, "意向单", "intentionOrderDetail", "page"),

    VENDOR_CENTER(13, "供应商", "vendorCenterDetail", "page"),

    LIVE_STAR_SETTLEMENT(14, "直播红人结算单", "settlementFormDetail", "page"),

    SAMPLE_PRICING(15, "样品核价单", "detailSamplePrice", "page"),
    ;

    @Getter
    private Integer type;

    @Getter
    private String desc;

    @Getter
    private String url;

    @Getter
    private String jumpUrlType;

    public static CommentBusinessTypeEnum toEnum(Integer type) {
        CommentBusinessTypeEnum typeEnum = null;
        for (CommentBusinessTypeEnum item : CommentBusinessTypeEnum.values()) {
            if (item.getType().equals(type)) {
                typeEnum = item;
                break;
            }
        }
        return typeEnum;
    }
}
